package com.sls.mall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.sls.mall.common.valid.AddGroup;
import com.sls.mall.common.valid.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * 品牌
 * 
 * @author tg
 * @email tg@gmail.com
 * @date 2021-04-24 16:14:45
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * $column.comments
	 */
	@NotNull(message = "品牌修改必须指定id",groups = {UpdateGroup.class})
	@Null(message = "品牌新增id必须为空",groups = {AddGroup.class})
	@TableId
	private Long brandId;
	/**
	 * $column.comments
	 */
	@NotBlank(message = "品牌名字不能为空",groups = {UpdateGroup.class, AddGroup.class})
	private String name;
	/**
	 * $column.comments
	 */
	@NotBlank(groups = {AddGroup.class})
	@URL(message = "logo必须是一个合法的url地址",groups = {AddGroup.class,UpdateGroup.class})
	private String logo;
	/**
	 * $column.comments
	 */
	private String descript;
	/**
	 * $column.comments
	 *
	 * 如果 单独设置与全局设置不一样 ，使用 (value = "1",delval = "0") 单独设置
	 */
	@TableLogic(value = "1",delval = "0")
	private Integer showStatus;
	/**
	 * $column.comments
	 */
	@NotEmpty
	@Pattern(regexp = "/^[a-zA-Z]$/",message = "检索首字母必须是一个字母")
	private String firstLetter;
	/**
	 * $column.comments
	 */
	@NotNull
	@Min(value = 0,message = "排序必须大于0")
	private Integer sort;

}
